<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/api/sockets.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('sockets_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">sockets.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="sockets_8h.html">lwip/sockets.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="sockets__priv_8h.html">lwip/priv/sockets_priv.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="api_8h.html">lwip/api.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="igmp_8h.html">lwip/igmp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="lwip_2inet_8h.html">lwip/inet.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="tcp_8h.html">lwip/tcp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="raw_8h.html">lwip/raw.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="udp_8h.html">lwip/udp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="memp_8h.html">lwip/memp.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="pbuf_8h.html">lwip/pbuf.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="netif_8h.html">lwip/netif.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="tcpip__priv_8h.html">lwip/priv/tcpip_priv.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mld6_8h.html">lwip/mld6.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;path/to/my/lwip_hooks.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionsockaddr__aligned.html">sockaddr_aligned</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a2f15a466e75cbaaea0c31e63116870f9"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sockets_8c.html#a2f15a466e75cbaaea0c31e63116870f9">lwip_pollscan_opts</a> { <a class="el" href="sockets_8c.html#a2f15a466e75cbaaea0c31e63116870f9aa9a8fe3199d00016f1f5ad639e1b28f7">LWIP_POLLSCAN_CLEAR</a> = 1, 
<a class="el" href="sockets_8c.html#a2f15a466e75cbaaea0c31e63116870f9ab6511d3104f70c18fb4bd80f24cb867d">LWIP_POLLSCAN_INC_WAIT</a> = 2, 
<a class="el" href="sockets_8c.html#a2f15a466e75cbaaea0c31e63116870f9a6c1eefa3e29a39b923c4b522eb1b3eb1">LWIP_POLLSCAN_DEC_WAIT</a> = 4
 }</td></tr>
<tr class="separator:a2f15a466e75cbaaea0c31e63116870f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0a250b3b4d1827e3a3661327f5e80ae0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sockets_8c.html#a0a250b3b4d1827e3a3661327f5e80ae0">lwip_socket_thread_init</a> (void)</td></tr>
<tr class="separator:a0a250b3b4d1827e3a3661327f5e80ae0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8cd92b10dbe3fb33da03faed1ea98a7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sockets_8c.html#ab8cd92b10dbe3fb33da03faed1ea98a7">lwip_socket_thread_cleanup</a> (void)</td></tr>
<tr class="separator:ab8cd92b10dbe3fb33da03faed1ea98a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abee6ee286147cf334a1ba19f19b2e08b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sockets_8c.html#abee6ee286147cf334a1ba19f19b2e08b">lwip_listen</a> (int s, int backlog)</td></tr>
<tr class="separator:abee6ee286147cf334a1ba19f19b2e08b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade85c68b6673296c8fb67127b93fa4c1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sockets_8c.html#ade85c68b6673296c8fb67127b93fa4c1">lwip_shutdown</a> (int s, int how)</td></tr>
<tr class="separator:ade85c68b6673296c8fb67127b93fa4c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae84296093574ec746f8f88321356388f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sockets_8c.html#ae84296093574ec746f8f88321356388f">lwip_fcntl</a> (int s, int cmd, int val)</td></tr>
<tr class="separator:ae84296093574ec746f8f88321356388f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Sockets BSD-Like API module </p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a2f15a466e75cbaaea0c31e63116870f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f15a466e75cbaaea0c31e63116870f9">&#9670;&nbsp;</a></span>lwip_pollscan_opts</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="sockets_8c.html#a2f15a466e75cbaaea0c31e63116870f9">lwip_pollscan_opts</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Options for the lwip_pollscan function. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a2f15a466e75cbaaea0c31e63116870f9aa9a8fe3199d00016f1f5ad639e1b28f7"></a>LWIP_POLLSCAN_CLEAR&#160;</td><td class="fielddoc"><p>Clear revents in each struct pollfd. </p>
</td></tr>
<tr><td class="fieldname"><a id="a2f15a466e75cbaaea0c31e63116870f9ab6511d3104f70c18fb4bd80f24cb867d"></a>LWIP_POLLSCAN_INC_WAIT&#160;</td><td class="fielddoc"><p>Increment select_waiting in each struct <a class="el" href="structlwip__sock.html">lwip_sock</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="a2f15a466e75cbaaea0c31e63116870f9a6c1eefa3e29a39b923c4b522eb1b3eb1"></a>LWIP_POLLSCAN_DEC_WAIT&#160;</td><td class="fielddoc"><p>Decrement select_waiting in each struct <a class="el" href="structlwip__sock.html">lwip_sock</a>. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ae84296093574ec746f8f88321356388f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae84296093574ec746f8f88321356388f">&#9670;&nbsp;</a></span>lwip_fcntl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int lwip_fcntl </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A minimal implementation of fcntl. Currently only the commands F_GETFL and F_SETFL are implemented. The flag O_NONBLOCK and access modes are supported for F_GETFL, only the flag O_NONBLOCK is implemented for F_SETFL. </p>

</div>
</div>
<a id="abee6ee286147cf334a1ba19f19b2e08b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abee6ee286147cf334a1ba19f19b2e08b">&#9670;&nbsp;</a></span>lwip_listen()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int lwip_listen </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>backlog</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set a socket into listen mode. The socket may not have been used for another connection previously.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>the socket to set to listening mode </td></tr>
    <tr><td class="paramname">backlog</td><td>(ATTENTION: needs TCP_LISTEN_BACKLOG=1) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, non-zero on failure </dd></dl>

</div>
</div>
<a id="ade85c68b6673296c8fb67127b93fa4c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade85c68b6673296c8fb67127b93fa4c1">&#9670;&nbsp;</a></span>lwip_shutdown()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int lwip_shutdown </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>how</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Close one end of a full-duplex connection. </p>

</div>
</div>
<a id="ab8cd92b10dbe3fb33da03faed1ea98a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8cd92b10dbe3fb33da03faed1ea98a7">&#9670;&nbsp;</a></span>lwip_socket_thread_cleanup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void lwip_socket_thread_cleanup </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore </p>

</div>
</div>
<a id="a0a250b3b4d1827e3a3661327f5e80ae0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a250b3b4d1827e3a3661327f5e80ae0">&#9670;&nbsp;</a></span>lwip_socket_thread_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void lwip_socket_thread_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_da61e3e9a357748887e3ca8d7c5a0c16.html">api</a></li><li class="navelem"><a class="el" href="sockets_8c.html">sockets.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
